]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionUtils: Use a unique 'subdir' to create new importers
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 17 Oct 2016 21:05:05 +0000 (23:05 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 18 Oct 2016 17:19:32 +0000 (19:19 +0200)
Apparently importers for the 'same' path are shared, even when the
relative paths resolve to different absolute ones. Until this bug
is fixed properly, we can work around this by expressing the current
extension path as the UUID relative to the parent directory.

https://bugzilla.gnome.org/show_bug.cgi?id=772386

js/misc/extensionUtils.js

index 65d02c29a38133ebd182fea733d9f19df2d77d9d..15438c2935d08e088b75a749a6b8a6c81807b329 100644 (file)
@@ -151,10 +151,10 @@ function createExtensionObject(uuid, dir, type) {
 
 function installImporter(extension) {
     let oldSearchPath = imports.searchPath.slice();  // make a copy
-    imports.searchPath = [extension.path];
+    imports.searchPath = [extension.dir.get_parent().get_path()];
     // importing a "subdir" creates a new importer object that doesn't affect
     // the global one
-    extension.imports = imports['.'];
+    extension.imports = imports[extension.uuid];
     imports.searchPath = oldSearchPath;
 }